import {ref,reactive} from 'vue'
import {defineStore} from 'pinia'
import { paymentManagementListGet, paymentManagementPageGet} from '@/api/paymentManagementApi.js';

export const usePaymentManagementStore = defineStore('paymentManagement', () => {

const paymentManagementPage = ref([])
const paymentManagementList = ref([])
const pagination = reactive({
    current:1,
    total:0
})

async function getPaymentManagementPage(query = {}) {
let {records, current, total} =await paymentManagementPageGet(query)
paymentManagementPage.value = records
pagination.current = current
pagination.total = total
}

async function getPaymentManagementList(query = {}) {
paymentManagementList.value = await paymentManagementListGet(query)
}


return {
pagination,
paymentManagementPage, getPaymentManagementPage,getPaymentManagementList}
})
